<link rel="stylesheet" type="text/css" media="all" href="/static/assets/css/daterangepicker-bs3.css" />
<!--<script type="text/javascript" src="/static/assets/js/jquery-1.8.3.min.js"></script>-->
<!--<script type="text/javascript" src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>-->
<script type="text/javascript" src="/static/assets/js/moment.js"></script>
<script type="text/javascript" src="/static/assets/js/daterangepicker.js"></script>
<input hidden="hidden" id="navValue" value="购物券">
<div class="page-content">
    <div class="page-header">
        <h1>
            账户资产
            <small>
                <i class="ace-icon fa fa-angle-double-right"></i>
                个人购物券记录
            </small>
        </h1>
    </div><!-- /.page-header -->
    <div class="row">
        <from id="from_post" class="form-horizontal user-data" action="{:url('Marketing/info')}" method="POST">
            <div class="form-group">
                <div class="col-md-3 no-margin-right no-padding-right" style="line-height: 13px;">
                    <label class="col-sm-4 control-label no-padding-right" for="form-field-1"> 交易方式:&nbsp;&nbsp;</label>
                    <select class="col-md-5" id="type">
                        <option value="0" >全部</option>
                        <option value="1" {if $type=='1'}selected = "selected"{/if}>牡丹苗平台返还</option>
                        <option value="2" {if $type=='2'}selected = "selected"{/if}>沃麦加返还</option>
                        <option value="3" {if $type=='3'}selected = "selected"{/if}>积分兑换</option>
                        <option value="4" {if $type=='4'}selected = "selected"{/if}>沃积分兑换</option>
                        <option value="5" {if $type=='5'}selected = "selected"{/if}>购物抵扣</option>
                    </select>
                </div>
                <div class="col-md-4 no-margin-right no-padding-right">
                    <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 帐号:&nbsp;&nbsp;</label>
                    <input type="text" id="launch" class="col-sm-6" value="{$mobile}">
                </div>
                <div class="col-md-4">
                    <div class="input-prepend input-group">
                        <span class="add-on input-group-addon"><i class="glyphicon glyphicon-calendar fa fa-calendar"></i></span>
                        {if empty($date)}
                        <input class="date" id="Date" type="date" value="">
                        {else /}
                        <input class="date" id="Date" type="date" value="{$date|date='Y-m-d' ,###}">
                        {/if}
                    </div>
                </div>
                <button type="submit" id="searchBtn" style="margin-left: 30px;" class="dt-button buttons-collection buttons-colvis btn btn-white btn-primary btn-bold" tabindex="0" aria-controls="dynamic-table" data-original-title="" title="查询"><span><i class="fa fa-search bigger-110 blue"></i></span></button>
            </div>
        </from>
    </div><!-- /.row -->
    <div style="height:20px;margin-bottom: 10px">
        <span class="col-md-2">ID:&nbsp;&nbsp;{$id}</span>
        <span class="col-md-2">昵称:&nbsp;&nbsp;{$nickname}</span>
        <span class="col-md-2">姓名:&nbsp;&nbsp;{$realname}</span>
        <span class="col-md-2">手机号:&nbsp;&nbsp;{$mobile}</span>
        <span class="col-md-2">购物券:&nbsp;&nbsp;{$credit4}</span>
    </div>
    {if !empty($list)}
    <div class="row">
        <div class="col-xs-12">
            <table id="simple-table" class="table  table-bordered table-hover">
                <thead>
                <tr>
                    <th class="center">序号</th>
                    <th class="center">帐号</th>
                    <th class="center">姓名</th>
                    <th class="center">交易方式</th>
                    <th class="center">数量</th>
                    <th class="center">剩余购物券</th>
                    <th class="center">发起账号</th>
                    <th class="center">收到帐号</th>
                    <th class="center">交易时间</th>
                </tr>
                </thead>

                <tbody>
                {foreach $list as $key => $val}
                <tr  class="center">
                    <td>{$key+1}</td>
                    <td>{$val['mobile']}</td>
                    <td>{$val['relname']}</td>
                    <td>{$val['remark']}</td>
                    {if condition="$val['num'] < 0 "}
                    <td style="color: blue">{$val['num']}</td>
                    {else /}
                    <td style="color: red">+{$val['num']}</td>
                    {/if}
                    <td>{$val['surplus']}</td>
                    <td>{$val['from']}</td>
                    <td>{$val['mobile']}</td>
                    <td class="dateval">{$val['createtime']|date="Y-m-d H:i" ,###}</td>
                </tr>
                {/foreach}
                </tbody>
            </table>
            {$page_html['html']}
        </div><!-- /.span -->
    </div><!-- /.row -->
    {else/}
    <div class="row" style="font-size: 14px;margin-top: 50px"><center> {$message}</center></div>
    {/if}
</div>
<script>
    $(function () {
        $("#searchBtn").click(function () {
            var type = $("#type").val();
            var launch = $("#launch").val();
            var Date = $("#Date").val();
            var text_href = "?type="+type;
            if(launch!=''){
                text_href += "&launch="+launch;
            }
            if(Date!=''){
                text_href += "&date="+Date;
            }
            location.href=location.href.split('?')[0]+text_href;
        });
    })
</script>

